import React, { Component } from "react";
import {  getMultiLang } from 'nc-lightapp-front';

class Total extends Component {
  constructor(props) {
    super(props);
    this.state = {
      multiLang: {}
    }
  }

  componentDidMount() {
    getMultiLang({
      moduleId: 2011,
      domainName: 'erm',
      currentLocale: 'simpchn',
      callback: (json) => {
          this.setState({multiLang: json})
      }
  })
  }
  render() {
    const {
      ybjyTotal=0,
      amountRepaidTotal=0,
      repaymentingTotal=0,
      amountToBeRepaidTotal=0,
    } = this.props;

    let { multiLang } = this.state
    const vv = multiLang['201102JK_D-0001']
    console.log(vv)
    return (
      <div className="total">
        <div>
          <p>{multiLang['201102JK_D-0001']}</p>
          <p>{ ybjyTotal }</p>
        </div>
        <div>
          <p>{multiLang['201102JK_D-0002']}</p>
          <p>{ amountRepaidTotal }</p>
        </div>
        <div>
          <p>{multiLang['201102JK_D-0003']}</p>
          <p>{ repaymentingTotal }</p>
        </div>
        <div>
          <p>{multiLang['201102JK_D-0004']}</p>
          <p>{ amountToBeRepaidTotal }</p>
        </div>
      </div>
    );
  }
}

export default Total;
